﻿namespace BorgExt
{
    public class PlugType : Qualifiable
    {
        public ExtensionType ExtensionType { get; internal set; }
        public MetaElementCollection<Param> Params { get; internal set; }
        public SlotDefinition SlotDefinition { get; internal set; }

        public bool AutoPlug { get; set; }
        public bool AutoSelect { get; set; }

        internal EventHandlerInfo OnPlugged { get; set; }
        internal EventHandlerInfo OnUnplugged { get; set; }

        internal EventHandlerInfo OnSelected { get; set; }
        internal EventHandlerInfo OnDeselected { get; set; }

        public override bool IsQualified
        {
            get { return Qualifier.IsQualified(this); }
        }

        internal PlugType(int id, string name)
            : base(id, name)
        { }

        public override bool Qualify()
        {
            return Qualifier.InternalWeakQualify(this);
        }

        internal override AssemblyElement GetAssemblyElement()
        {
            return ExtensionType.Plugin;
        }
    }
}

